package base.exa12;

public class InstanceofStudy {

    public static void main(String[] args) {
        /*这条语句的执行意味着，money，leg，height，action都被分配了空间*/
        Man1 you = new Man1();
        if(you instanceof Man1){
            System.out.println("I am a man");
        }
        System.out.println(you instanceof People1);
    }
}

class People1{
    private int leg = 2;
    int money;
    void action(){
        leg = 5;
        System.out.println("I am a man");
    }
}

class Man1 extends People1{
    int height;
}